/**
 * Created by Administrator on 2018/11/25 0025.
 */
/**
 * @author htl
 * @date 2018/11/25 0014
 * @Description:
 */
const mongoose = require('mongoose');
const dictKindSchema = new mongoose.Schema({
    value: {
        type: String,
        trim: true,
        default: '',
        required: true
    },
    code: {
        type: String,
        required: true,
        default: '',
    }
})
//获取数据总条数
dictKindSchema.statics.getCount = function(cb) {
    this.count((err,num) => {
        if(err) {
            return new Error(err);
        }
        cb(num)
    })
}
const dictKindModel = mongoose.model('dictKind',dictKindSchema); //创建集合（表）


module.exports = dictKindModel;
